import request from "@/utils/request"

//请求1:获取分页 角色列表 (搜索)
export const reqGetUserRoleListByPage = (page,limit,roleName)=>{
    return request.get(`/admin/acl/role/${page}/${limit}`,{params:{roleName}})
}

//请求2:添加角色
export const reqAddRole = (roleName)=>{
    return request.post(`/admin/acl/role/save`,{roleName})
}

//请求3：批量删除角色
export const reqDeleteRoleList = (idList) =>{
    return request.post(`/admin/acl/role/batchRemove`,idList)
}

//请求4：根据角色获取菜单
export const reqGetRoleMenu = (roleId) =>{
    return request.get(`/admin/acl/permission/toAssign/${roleId}`)
}

//请求5:给角色分配权限
export const reqRoleAssignPermission = (roleId,permissionId) =>{
    return request.post(`/admin/acl/permission/doAssign`,null,{params:{roleId,permissionId}})
}

//请求6:更新角色信息
export const reqUpdateRoleInfo = (role) =>{
    return request.put(`/admin/acl/role/update`,role)
}